#include <QtGui/QApplication>
#include <KDE/Nepomuk/ResourceManager>
#include <KDE/Nepomuk/Tag>
#include <KDE/Nepomuk/Resource>
#include <KDE/Nepomuk/File>
#include <KDE/Nepomuk/Thing>
// #include <KDE/Nepomuk/Vocabulary/NMM>
#include <KDE/Nepomuk/Variant>





#include <phonon/MediaObject>

#include <vlc/libvlc.h>
#include <vlc/libvlc_media.h>
#include <vlc/libvlc_media_player.h>
#include <phonon/videoplayer.h>
#include "mainwindow.h"
#include <QDebug>
#include <QMdiArea>
#include <QMdiSubWindow>
#include <QtDeclarative/QDeclarativeView>
#include <QDockWidget>


int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    Nepomuk::ResourceManager::instance()->init();
    //Nepomuk::Vocabulary::NMM::Movie m ("ll");
    Nepomuk::Resource f("/tmp/manu/film.avi");
    qDebug()<<"file exists :"<< f.exists();

    Nepomuk::Thing thi("allocine_12345");
    qDebug()<<"exists:"<< thi.exists();
    //const Nepomuk::Variant v("ceci est un titre");
    //thi.setProperty("title", v);

    qDebug()<<"title:"<< thi.property("title");
    qDebug()<<"mFile:"<< thi.property("mFile");

    //thi.setProperty("mFile", f);
    Nepomuk::Variant f2 = thi.property("mFile");
    qDebug()<<"mFile resourceUrl:"<<f2.toResource().toFile().resourceType();
    Nepomuk::Tag tag( "MyTag43" );
    f.addTag( tag );


    //Nepomuk::Tag tag( "MyTag42" );


    //Nepomuk::Tag tag( "MyTag42" );
    //tag.setLabel("myLabel");
    //tag.setProperty();
    //f.addTag( tag );
    //Nepomuk::File f2("/home/manu/La\ Légende\ De\ Bruce\ lee\ 2011.avi");
    /*QList<Nepomuk::Tag> tags = f.tags();
    QListIterator<Nepomuk::Tag> it( tags );
    while( it.hasNext() ){
        Nepomuk::Tag t = it.next();
        qDebug() << "File tagged with tag: " << t.genericLabel() << " ==>"<< t.label() ;
    }
    //MainWindow w;




   /* Phonon::VideoPlayer * videoWidget = new Phonon::VideoPlayer(Phonon::VideoCategory);
    videoWidget->play(QUrl("/home/manu/movie.avi"));
    videoWidget->show();
    //videoWidget->setAttribute(Qt::WA_PendingResizeEvent);


    QDeclarativeView * qmlViewer = new QDeclarativeView(videoWidget);

    qmlViewer->setWindowFlags(Qt::X11BypassWindowManagerHint);

    qmlViewer->setAttribute(Qt::WA_TranslucentBackground);
    qmlViewer->setStyleSheet("background:transparent;");
    qmlViewer->setSource(QUrl::fromLocalFile("/socMDC/KdeadMouse/apps/videoplayer/qml/progressBar.qml"));
    qmlViewer->setGeometry(0,0,400,400);
    qmlViewer->show();
*/


    return a.exec();
}
